{ include file="../Common/head_authority.html" }
<body>
<div class="container-fluid">
    <div class="row" style="margin: 20px 0px;">
        <b>设置{$smarty.get.name}权限</b>
        <a href="javascript:history.back();" style="float: right;">返回</a>
    </div>
    <div class="row" style="height: 35px;line-height:35px;margin-top: 5px;">
        <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-5 col-md-5 col-lg-5">
            <input type="checkbox" id="checkAll" style="display: inline-block;vertical-align: middle;margin-bottom: 5px;margin-right: 10px;"/>
            <label style="line-height: 35px;margin-bottom: 0px;">全选</label>
        </div>
    </div>
    <form action="#" method="post">
        { foreach from="$firstMenu" item="f" }
        <div class="row" style="height: 35px;line-height:35px;margin-top: 25px;margin-bottom: 5px;">
            <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-2 col-sm-5 col-md-5 col-lg-5">
                <b style="line-height: 35px;margin-bottom: 0px;">{$f.title}</b>
            </div>
        </div>
            { foreach from="$secondMenu" item="s" }
                {if $f.id eq $s.parent_id}
                    {if in_array($s.id, $radata)}
                    <div class="row" style="height: 35px;line-height:35px;margin-top: 5px;padding-left: 35px;">
                        <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-2 col-sm-5 col-md-5 col-lg-5">
                            <input type="checkbox" checked name="aid[]" value="{$s.id}" style="display: inline-block;vertical-align: middle;margin-bottom: 5px;margin-right: 10px;"/>
                            <label style="line-height: 35px;margin-bottom: 0px;">{$s.title}</label>
                        </div>
                    </div>
                    {else}
                    <div class="row" style="height: 35px;line-height:35px;margin-top: 5px;padding-left: 35px;">
                        <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-2 col-sm-5 col-md-5 col-lg-5">
                            <input type="checkbox" name="aid[]" value="{$s.id}" style="display: inline-block;vertical-align: middle;margin-bottom: 5px;margin-right: 10px;"/>
                            <label style="line-height: 35px;margin-bottom: 0px;">{$s.title}</label>
                        </div>
                    </div>
                    {/if}
                {/if}
                { foreach from="$thirdMenu" item="t" }
                    {if $s.id eq $t.parent_id && $s.parent_id eq $f.id}
                        {if in_array($t.id, $radata)}
                        <div class="row" style="height: 35px;line-height:35px;margin-top: 5px;padding-left: 65px;">
                            <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-2 col-sm-5 col-md-5 col-lg-5">
                                <input type="checkbox" checked name="aid[]" value="{$t.id}" style="display: inline-block;vertical-align: middle;margin-bottom: 5px;margin-right: 10px;"/>
                                <label style="line-height: 35px;margin-bottom: 0px;">{$t.title}</label>
                            </div>
                        </div>
                        {else}
                        <div class="row" style="height: 35px;line-height:35px;margin-top: 5px;padding-left: 65px;">
                            <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-2 col-sm-5 col-md-5 col-lg-5">
                                <input type="checkbox" name="aid[]" value="{$t.id}" style="display: inline-block;vertical-align: middle;margin-bottom: 5px;margin-right: 10px;"/>
                                <label style="line-height: 35px;margin-bottom: 0px;">{$t.title}</label>
                            </div>
                        </div>
                        {/if}
                    {/if}
                {/foreach}
            {/foreach}
        { /foreach }
        <div class="row" style="height: 35px;line-height: 35px;margin-top: 15px;">
            <div class="col-sm-4 col-md-4 col-lg-4" style="text-align: right"></div>
            <div class="col-sm-3 col-md-3 col-lg-3">
                <button type="submit" id="aa" class="btn btn-primary pull-right">保存</button>
            </div>
        </div>
    </form>
{literal}
    <script>
        $("#checkAll").click(function(){
            if(this.checked){
                $('input:checkbox').each(function(){
                    if(!this.checked){
                        $(this).attr('checked', true);
                    }
                })
            }else{
                $('input:checkbox').each(function(){
                    if(this.checked){
                        $(this).attr('checked', false);
                    }
                })
            }
        })
        $("#aa").click(function(){
            $("[name='aid']").each(function(){
                if(this.checked){
                    alert($(this).val());
                }
            })
        })
    </script>
{/literal}

</body>
</html>